/**
 * 
 */
package de.fsujena.chat_pi.message;

import java.util.Date;

/**
 * Generalized representation of a message, containing basic informations of the message
 * including sender, receiver, time.
 * 
 * @author Erik Hebestreit
 * @see SysMessage
 * @see TextMessage
 * @see FileMessage
 */
public abstract class Message implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4343909843619593730L;
	
	private Long messageId;
	
	private Date sent;
	private Date received;
	// Date read;
	
	private String senderUsername;
	private String targetRoom;
	
	private boolean expectAcknoledgement = false;
	
	/**
	 * 
	 */
	public Message() {
		if (this.getMessageId() == null) {
			this.setMessageId(new Date().getTime());
		}
	}

	public Long getMessageId() {
		return messageId;
	}

	public void setMessageId(Long messageId) {
		this.messageId = messageId;
	}

	public Date getSent() {
		return sent;
	}

	public void setSent(Date sent) {
		this.sent = sent;
	}

	public Date getReceived() {
		return received;
	}

	public void setReceived(Date received) {
		this.received = received;
	}

	public String getSenderUsername() {
		return senderUsername;
	}

	public void setSenderUsername(String senderUsername) {
		this.senderUsername = senderUsername;
	}

	public String getTargetRoom() {
		return targetRoom;
	}

	public void setTargetRoom(String targetRoom) {
		this.targetRoom = targetRoom;
	}

	public boolean isExpectAcknoledgement() {
		return expectAcknoledgement;
	}

	public void setExpectAcknoledgement(boolean expectAcknoledgement) {
		this.expectAcknoledgement = expectAcknoledgement;
	}
}
